<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<script type="text/javascript">
function ConfirmMsg(){
	alertMsg.confirm("确定要修改操作要求？", {
		okCall: function(){
			var myForm = document.getElementById("myForm");
			myForm.onsubmit();
		}
	});
}
</script>

<div class="pageContent">
	<form id="myForm" method="post" action="<%=basePath%>operat_updateOperat.action" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone)">
		<div class="pageFormContent" layoutH="56">
				<div class="pageFormContent1" style=" width:96%">
					<table class="table" width="100%" layoutH="220">
						<thead>
							<tr>
								<th width="">渠道名称</th>
								<th width="">条件名</th>
								<th width="">条件类别</th>
								<th width="">条件公式</th>
								<th width="">金额</th>
								<th width="">说明</th>
								<th width="">添加日期</th>
								<th width="">状态</th>
								<th width="">编辑</th>
							</tr>
						</thead>
						<tbody>
						<c:forEach items="${operats}" var="op">
							<tr target="sid_user" rel="${op.POperatId}">
								<td>${op.PChannelName}</td>
								<td>${op.POperatName}</td>
								<td>
									<c:if test="${op.POperatCalss == 'LG'}">
										货物长
									</c:if>
									<c:if test="${op.POperatCalss == 'HH'}">
										货物高
									</c:if>
									<c:if test="${op.POperatCalss == 'WE'}">
										货物宽
									</c:if>
									<c:if test="${op.POperatCalss == 'PR'}">
										货物周长
									</c:if>
									<c:if test="${op.POperatCalss == 'MW'}">
										货物材重
									</c:if>
									<c:if test="${op.POperatCalss == 'TW'}">
										货物实重
									</c:if>
									<c:if test="${op.POperatCalss == 'TE'}">
										货物类型
									</c:if>
								</td>
								<td><c:out value="${op.POpertCondition}" ></c:out></td>
								<td>${op.POperatCost}</td>
								<td>${op.POperatNote}</td>
								<td>${op.POperatAddDate}</td>
								<td>
									<c:if test="${op.POperatStatus == 'NE'}">
										启用
									</c:if>
									<c:if test="${op.POperatStatus == 'CL'}">
										停用
									</c:if>
								</td>
								<td>
								<a target="ajaxTodo" href="/EServer/operat_getOperatById.action?ePOperatId=${op.POperatId}" class="btnEdit">编辑</a>
								</td>
								
							</tr>
						</c:forEach>
						</tbody>
					</table>
			</div>
			<div  class="pageFormContent">
				<p>
					<label>渠道名称：</label>
					<input name="pOperat.PChannelName" type="text" value="${channelABean.channel.PChannelName}" readonly="readonly" size="30" />
					<input name="uOperat.PChannelNumber" type="hidden" value="${channelABean.channel.PChannelNumber}"/>
					<input name="uOperat.POperatId" type="hidden" value="${eOperat.POperatId}"/>
					<input name="uOperat.POperatAddDate" type="hidden" value="${eOperat.POperatAddDate}"/>
				</p>
				<p>
					<label>条件名：</label>
					<input value="${eOperat.POperatName}" maxlength="20" name="uOperat.POperatName" class="required" type="text" size="30" />
				</p>
				<p>
					<label>条件类别：</label>
					<input type="hidden" id="SGT" value="${eOperat.POperatCalss}"/>
					<select name="uOperat.POperatCalss" class="required combox">
						<option id="LG" value="LG" selected>货物长</option>
						<option id="HH" value="HH">货物高 </option>
						<option id="WE" value="WE">货物宽 </option>
						<option id="PR" value="PR">货物周长</option>
						<option id="MW" value="MW">货物材重 </option>
						<option id="TW" value="TW">货物实重 </option>
						<option id="TE" value="TE">货物类型 </option>
					</select>
				</p>
				<p>
					<label>条件公式：</label>
					<input value="${eOperat.POpertCondition}" maxlength="20" name="uOperat.POpertCondition" class="required" type="text" size="30" />
				</p>
				<p>
					<label>金额：</label>
					<input value="${eOperat.POperatCost}" maxlength="10" name="uOperat.POperatCost" class="required number" max="99999" type="text" size="30" />
				</p>
				<p>
					<label>说明：</label>
					<textarea maxlength="50" name="uOperat.POperatNote" class="" rows="2" cols="24">${eOperat.POperatNote}</textarea>
				</p>
				<p>
					<label>状态：</label>
					<select name="uOperat.POperatStatus" class="required combox">
						<option value="NE" selected>启用</option>
						<option value="CL">停用</option>
					</select>
				</p>
			
			</div>
		</div>
		<div class="formBar">
			<ul>
				<!--
				<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li> 
				-->
				<li><a class="button" href="javascript:;" onclick="ConfirmMsg()"><span>保存修改</span></a></li>
				
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>
<script type="text/javascript">
	$(document).ready(function(){
		var sgt = document.getElementById("SGT").value;
		document.getElementById(sgt).selected = "true";
	});
</script>
